# Contributor: Milan P. Stanić <mps@arvanta.net>
# Contributor: Maxim Karasev <begs@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=arm-trusted-firmware
pkgver=2.6
pkgrel=1
pkgdesc="ARM Trusted Firmware-A (TF-A)"
url="https://github.com/ARM-software/arm-trusted-firmware"
arch="aarch64"
license="BSD-3-Clause"
makedepends="dtc"
source="https://github.com/ARM-software/arm-trusted-firmware/archive/v$pkgver/arm-trusted-firmware-v$pkgver.tar.gz"
options="!check" # No tests

_plats="
	imx8mq
	sun50i_a64
	sun50i_h6
	"

build() {
	unset LDFLAGS
	for plat in $_plats; do
		msg "Building ATF for $plat"
		make PLAT=$plat bl31
	done
}

package() {
	for plat in $_plats; do
		install -D "$builddir"/build/$plat/release/bl31.bin \
			"$pkgdir"/usr/share/$pkgname/$plat/bl31.bin
	done
}

sha512sums="
8b20964b1b672898268e27424984af0ef9e95b38f426370ed4b802f67fc204db5f467886707dce77e4560548e01777a6c36d4eb801842c7d1f2ff6ca5d9b7dd1  arm-trusted-firmware-v2.6.tar.gz
"
